Function.prototype.mycall = function (obj, ...args) {
  let key = Symbol("key")
  obj[key] = this
  let res = obj[key](...args)
  return res
}
Function.prototype.myapply = function (obj, args) {
  let key = Symbol("key")
  obj[key] = this
  let res = obj[key](...args)
  return res
}
Function.prototype.mybind = function (obj, ...args1) {
  let that = this
  return function (...agrs2) {
    console.log([...args1, ...agrs2]);
    that.apply(obj, [...args1, ...agrs2])
  }
}


let obj = { name: 1, age: 2 }

function demo() {
  console.log(this.name, this.age);
}

demo.mybind(obj, 1, 2, 3)(4, 5)

